# Contributor: psykose <alice@ayaya.dev>
# Maintainer: psykose <alice@ayaya.dev>
pkgname=artyfx
pkgver=1.3.1
pkgrel=1
pkgdesc="ArtyFX audio plugin bundle"
url="https://github.com/openAVproductions/openAV-ArtyFX"
options="!check" # no tests
arch="all !x86" # textrel
license="GPL-2.0-or-later"
makedepends="
	cairo-dev
	cmake
	libsamplerate-dev
	libsndfile-dev
	lv2-dev
	ninja
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/openAVproductions/openAV-ArtyFX/archive/refs/tags/release-$pkgver.tar.gz
	fix-sse.patch
	"
builddir="$srcdir/openAV-ArtyFX-release-$pkgver"

build() {
	_sse=OFF
	case "$CARCH" in
	x86*)
		_sse=ON
		;;
	esac
	export CXXFLAGS="$CXXFLAGS -fPIC"
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_VERBOSE_MAKEFILE=ON \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DBUILD_SSE=$_sse
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
7fe84783f460e5ac62d715990a7140259b8e2f1e0a531cf6cde63dadfb51e934abd17c81a8c280699279c0af2aa74ee05e073d32539d99fa37d83a0b1cfc0c49  artyfx-1.3.1.tar.gz
27db0c3056631f498ad0028acfab1888692eb91f4cd28d17f1128646e13d5646e89a27eda6387d3467e53d3932dd3bc39c3771a1ca9fc5d15fba54989ec332ea  fix-sse.patch
"
